this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["reviews-by-category"]=function(e){function t(t){for(var o,a,s=t[0],i=t[1],l=t[2],u=0,b=[];u<s.length;u++)a=s[u],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&b.push(c[a][0]),c[a]=0;for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o]);for(d&&d(t);b.length;)b.shift()();return n.push.apply(n,l||[]),r()}function r(){for(var e,t=0;t<n.length;t++){for(var r=n[t],o=!0,s=1;s<r.length;s++){var i=r[s];0!==c[i]&&(o=!1)}o&&(n.splice(t--,1),e=a(a.s=r[0]))}return e}var o={},c={52:0},n=[];function a(t){if(o[t])return o[t].exports;var r=o[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=o,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(r,o,function(t){return e[t]}.bind(null,o));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var s=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=s.push.bind(s);s.push=t,s=s.slice();for(var l=0;l<s.length;l++)t(s[l]);var d=i;return n.push([545,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.htmlEntities},102:function(e,t,r){"use strict";r.d(t,"a",(function(){return _}));var o=r(0),c=r(1),n=r(2),a=r(70),s=r(614),i=r(4),l=r.n(i),d=r(11),u=r(16),b=r(35),m=r(613),p=r(10);r(55);const g=({id:e,label:t,popoverContents:r,remove:s,screenReaderLabel:i,className:u=""})=>{const[b,w]=Object(o.useState)(!1),h=Object(d.useInstanceId)(g);if(i=i||t,!t)return null;t=Object(p.decodeEntities)(t);const O=l()("woocommerce-tag",u,{"has-remove":!!s}),v=`woocommerce-tag__label-${h}`,j=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},i),Object(o.createElement)("span",{"aria-hidden":"true"},t));return Object(o.createElement)("span",{className:O},r?Object(o.createElement)(n.Button,{className:"woocommerce-tag__text",id:v,onClick:()=>w(!0)},j):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:v},j),r&&b&&Object(o.createElement)(n.Popover,{onClose:()=>w(!1)},r),s&&Object(o.createElement)(n.Button,{className:"woocommerce-tag__remove",onClick:s(e),label:Object(c.sprintf)(
// Translators: %s label.
Object(c.__)("Remove %s","woocommerce"),t),"aria-describedby":v},Object(o.createElement)(a.a,{icon:m.a,size:20,className:"clear-icon"})))};var w=g;r(54);const h=e=>Object(o.createElement)(b.b,{...e}),O=e=>{const{list:t,selected:r,renderItem:c,depth:n=0,onSelect:a,instanceId:s,isSingle:i,search:l,useExpandedPanelId:d}=e,[u]=d;return t?Object(o.createElement)(o.Fragment,null,t.map((t=>{var b,m;const p=null!==(b=t.children)&&void 0!==b&&b.length&&!i?t.children.every((({id:e})=>r.find((t=>t.id===e)))):!!r.find((({id:e})=>e===t.id)),g=(null===(m=t.children)||void 0===m?void 0:m.length)&&u===t.id;return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,c({item:t,isSelected:p,onSelect:a,isSingle:i,selected:r,search:l,depth:n,useExpandedPanelId:d,controlId:s})),g?Object(o.createElement)(O,{...e,list:t.children,depth:n+1}):null)}))):null},v=({isLoading:e,isSingle:t,selected:r,messages:a,onChange:s,onRemove:i})=>{if(e||t||!r)return null;const l=r.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,a.selected(l)),l>0?Object(o.createElement)(n.Button,{isLink:!0,isDestructive:!0,onClick:()=>s([]),"aria-label":a.clear},Object(c.__)("Clear all","woocommerce")):null),l>0?Object(o.createElement)("ul",null,r.map(((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(w,{label:e.name,id:e.id,remove:i}))))):null)},j=({filteredList:e,search:t,onSelect:r,instanceId:n,useExpandedPanelId:i,...l})=>{const{messages:d,renderItem:u,selected:b,isSingle:m}=l,p=u||h;return 0===e.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(a.a,{icon:s.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},t?Object(c.sprintf)(d.noResults,t):d.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(O,{useExpandedPanelId:i,list:e,selected:b,renderItem:p,onSelect:r,instanceId:n,isSingle:m,search:t}))},_=e=>{const{className:t="",isCompact:r,isHierarchical:a,isLoading:s,isSingle:i,list:b,messages:m=u.a,onChange:p,onSearch:g,selected:w,type:h="text",debouncedSpeak:O}=e,[f,y]=Object(o.useState)(""),k=Object(o.useState)(-1),E=Object(d.useInstanceId)(_),R=Object(o.useMemo)((()=>({...u.a,...m})),[m]),C=Object(o.useMemo)((()=>Object(u.c)(b,f,a)),[b,f,a]);Object(o.useEffect)((()=>{O&&O(R.updated)}),[O,R]),Object(o.useEffect)((()=>{"function"==typeof g&&g(f)}),[f,g]);const S=Object(o.useCallback)((e=>()=>{i&&p([]);const t=w.findIndex((({id:t})=>t===e));p([...w.slice(0,t),...w.slice(t+1)])}),[i,w,p]),N=Object(o.useCallback)((e=>()=>{Array.isArray(e)?p(e):-1===w.findIndex((({id:t})=>t===e.id))?p(i?[e]:[...w,e]):S(e.id)()}),[i,S,p,w]),P=Object(o.useCallback)((e=>{const[t]=w.filter((t=>!e.find((e=>t.id===e.id))));S(t.id)()}),[S,w]);return Object(o.createElement)("div",{className:l()("woocommerce-search-list",t,{"is-compact":r,"is-loading":s,"is-token":"token"===h})},"text"===h&&Object(o.createElement)(v,{...e,onRemove:S,messages:R}),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},"text"===h?Object(o.createElement)(n.TextControl,{label:R.search,type:"search",value:f,onChange:e=>y(e)}):Object(o.createElement)(n.FormTokenField,{disabled:s,label:R.search,onChange:P,onInputChange:e=>y(e),suggestions:[],__experimentalValidateInput:()=>!1,value:s?[Object(c.__)("Loading…","woocommerce")]:w.map((e=>({...e,value:e.name}))),__experimentalShowHowTo:!1})),s?Object(o.createElement)("div",{className:"woocommerce-search-list__list"},Object(o.createElement)(n.Spinner,null)):Object(o.createElement)(j,{...e,search:f,filteredList:C,messages:R,onSelect:N,instanceId:E,useExpandedPanelId:k}))};Object(n.withSpokenMessages)(_)},106:function(e,t){},11:function(e,t){e.exports=window.wp.compose},124:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return d}));var o=r(0),c=r(1),n=r(5),a=r(3),s=r(2);const i=(e,t,r)=>Object(o.createElement)(n.BlockControls,null,Object(o.createElement)(s.ToolbarGroup,{controls:[{icon:"edit",title:r,onClick:()=>t({editMode:!e}),isActive:e}]})),l=(e,t)=>{const r=Object(a.getSetting)("showAvatars",!0),n=Object(a.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.ToggleControl,{label:Object(c.__)("Product rating","woocommerce"),checked:e.showReviewRating,onChange:()=>t({showReviewRating:!e.showReviewRating})}),e.showReviewRating&&!n&&Object(o.createElement)(s.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(c.__)("Product rating is disabled in your <a>store settings</a>.","woocommerce"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(s.ToggleControl,{label:Object(c.__)("Reviewer name","woocommerce"),checked:e.showReviewerName,onChange:()=>t({showReviewerName:!e.showReviewerName})}),Object(o.createElement)(s.ToggleControl,{label:Object(c.__)("Image","woocommerce"),checked:e.showReviewImage,onChange:()=>t({showReviewImage:!e.showReviewImage})}),Object(o.createElement)(s.ToggleControl,{label:Object(c.__)("Review date","woocommerce"),checked:e.showReviewDate,onChange:()=>t({showReviewDate:!e.showReviewDate})}),Object(o.createElement)(s.ToggleControl,{label:Object(c.__)("Review content","woocommerce"),checked:e.showReviewContent,onChange:()=>t({showReviewContent:!e.showReviewContent})}),e.showReviewImage&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.__experimentalToggleGroupControl,{label:Object(c.__)("Review image","woocommerce"),value:e.imageType,onChange:e=>t({imageType:e})},Object(o.createElement)(s.__experimentalToggleGroupControlOption,{value:"reviewer",label:Object(c.__)("Reviewer photo","woocommerce")}),Object(o.createElement)(s.__experimentalToggleGroupControlOption,{value:"product",label:Object(c.__)("Product","woocommerce")})),"reviewer"===e.imageType&&!r&&Object(o.createElement)(s.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(c.__)("Reviewer photo is disabled in your <a>site settings</a>.","woocommerce"),{a:Object(o.createElement)("a",{href:Object(a.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},d=(e,t)=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.ToggleControl,{label:Object(c.__)("Order by","woocommerce"),checked:e.showOrderby,onChange:()=>t({showOrderby:!e.showOrderby})}),Object(o.createElement)(s.SelectControl,{label:Object(c.__)("Order Product Reviews by","woocommerce"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:e=>t({orderby:e})}),Object(o.createElement)(s.RangeControl,{label:Object(c.__)("Starting Number of Reviews","woocommerce"),value:e.reviewsOnPageLoad,onChange:e=>t({reviewsOnPageLoad:e}),max:20,min:1}),Object(o.createElement)(s.ToggleControl,{label:Object(c.__)("Load more","woocommerce"),checked:e.showLoadMore,onChange:()=>t({showLoadMore:!e.showLoadMore})}),e.showLoadMore&&Object(o.createElement)(s.RangeControl,{label:Object(c.__)("Load More Reviews","woocommerce"),value:e.reviewsOnLoadMore,onChange:e=>t({reviewsOnLoadMore:e}),max:20,min:1}))},131:function(e,t){},137:function(e,t,r){"use strict";var o=r(0),c=r(4),n=r.n(c),a=r(29),s=r(11);r(188),t.a=Object(s.withInstanceId)((({className:e,instanceId:t,label:r="",onChange:c,options:s,screenReaderLabel:i,value:l=""})=>{const d=`wc-block-components-sort-select__select-${t}`;return Object(o.createElement)("div",{className:n()("wc-block-sort-select","wc-block-components-sort-select",e)},Object(o.createElement)(a.a,{label:r,screenReaderLabel:i,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(o.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:c,value:l},s&&s.map((e=>Object(o.createElement)("option",{key:e.key,value:e.key},e.label)))))}))},14:function(e,t){e.exports=window.wp.apiFetch},143:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var o=r(1),c=r(17);const n={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(o.__)("July 15, 2019","woocommerce"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(o.__)("WordPress Pennant","woocommerce"),product_permalink:"#",
/* translators: An example person name used for the block previews. */
reviewer:Object(o.__)("Alice","woocommerce"),review:`<p>${Object(o.__)("I bought this product last week and I'm very happy with it.","woocommerce")}</p>\n`,reviewer_avatar_urls:{48:c.p.defaultAvatar,96:c.p.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(o.__)("July 12, 2019","woocommerce"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(o.__)("WordPress Pennant","woocommerce"),product_permalink:"#",
/* translators: An example person name used for the block previews. */
reviewer:Object(o.__)("Bob","woocommerce"),review:`<p>${Object(o.__)("This product is awesome, I love it!","woocommerce")}</p>\n`,reviewer_avatar_urls:{48:c.p.defaultAvatar,96:c.p.defaultAvatar},rating:null,verified:!1}]}}},15:function(e,t){e.exports=window.wp.url},16:function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return d}));var o=r(0),c=r(1),n=r(57);const a={clear:Object(c.__)("Clear all selected items","woocommerce"),noItems:Object(c.__)("No items found.","woocommerce"),
/* Translators: %s search term */
noResults:Object(c.__)("No results for %s","woocommerce"),search:Object(c.__)("Search for items","woocommerce"),selected:e=>Object(c.sprintf)(/* translators: Number of items selected from list. */
Object(c._n)("%d item selected","%d items selected",e,"woocommerce"),e),updated:Object(c.__)("Search results updated.","woocommerce")},s=(e,t=e)=>{const r=e.reduce(((e,t)=>{const r=t.parent||0;return e[r]||(e[r]=[]),e[r].push(t),e}),{}),o=Object(n.a)(t,"id"),c=["0"],a=(e={})=>e.parent?[...a(o[e.parent]),e.name]:e.name?[e.name]:[],s=e=>e.map((e=>{const t=r[e.id];return c.push(""+e.id),{...e,breadcrumbs:a(o[e.parent]),children:t&&t.length?s(t):[]}})),i=s(r[0]||[]);return Object.entries(r).forEach((([e,t])=>{c.includes(e)||i.push(...s(t||[]))})),i},i=(e,t,r)=>{if(!t)return r?s(e):e;const o=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),c=e.map((e=>!!o.test(e.name)&&e)).filter(Boolean);return r?s(c,e):c},l=(e,t)=>{if(!t)return e;const r=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(r).map(((e,t)=>r.test(e)?Object(o.createElement)("strong",{key:t},e):Object(o.createElement)(o.Fragment,{key:t},e)))},d=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},168:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},169:function(e,t,r){"use strict";var o=r(0),c=r(5),n=(r(189),r(67));t.a=({attributes:e})=>Object(o.createElement)("div",{...c.useBlockProps.save({className:Object(n.a)(e)}),...Object(n.b)(e)})},17:function(e,t,r){"use strict";r.d(t,"p",(function(){return n})),r.d(t,"n",(function(){return a})),r.d(t,"m",(function(){return s})),r.d(t,"o",(function(){return i})),r.d(t,"k",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"h",(function(){return u})),r.d(t,"l",(function(){return b})),r.d(t,"c",(function(){return m})),r.d(t,"d",(function(){return p})),r.d(t,"g",(function(){return g})),r.d(t,"a",(function(){return O})),r.d(t,"b",(function(){return v})),r.d(t,"i",(function(){return j})),r.d(t,"j",(function(){return _})),r.d(t,"f",(function(){return f}));var o,c=r(3);const n=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=n.pluginUrl+"images/",s=n.pluginUrl+"build/",i=n.buildPhase,l=null===(o=c.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,d=c.STORE_PAGES.checkout.id,u=(c.STORE_PAGES.checkout.permalink,c.STORE_PAGES.privacy.permalink),b=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),m=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),p=c.STORE_PAGES.cart.permalink,g=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("localPickupEnabled",!1)),w=Object(c.getSetting)("countries",{}),h=Object(c.getSetting)("countryData",{}),O=Object.fromEntries(Object.keys(h).filter((e=>!0===h[e].allowBilling)).map((e=>[e,w[e]||""]))),v=Object.fromEntries(Object.keys(h).filter((e=>!0===h[e].allowBilling)).map((e=>[e,h[e].states||[]]))),j=Object.fromEntries(Object.keys(h).filter((e=>!0===h[e].allowShipping)).map((e=>[e,w[e]||""]))),_=Object.fromEntries(Object.keys(h).filter((e=>!0===h[e].allowShipping)).map((e=>[e,h[e].states||[]]))),f=Object.fromEntries(Object.keys(h).map((e=>[e,h[e].locale||[]])))},175:function(e,t,r){"use strict";var o=r(0),c=r(1),n=r(289),a=r(2),s=r(5),i=r(3),l=r(88),d=r(29);r(223);var u=({onClick:e,label:t=Object(c.__)("Load more","woocommerce"),screenReaderLabel:r=Object(c.__)("Load more","woocommerce")})=>Object(o.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(o.createElement)("button",{className:"wp-block-button__link",onClick:e},Object(o.createElement)(d.a,{label:t,screenReaderLabel:r}))),b=r(137);r(220);var m=({onChange:e,readOnly:t,value:r})=>Object(o.createElement)(b.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(c.__)("Order by","woocommerce"),onChange:e,options:[{key:"most-recent",label:Object(c.__)("Most recent","woocommerce")},{key:"highest-rating",label:Object(c.__)("Highest rating","woocommerce")},{key:"lowest-rating",label:Object(c.__)("Lowest rating","woocommerce")}],readOnly:t,screenReaderLabel:Object(c.__)("Order reviews by","woocommerce"),value:r}),p=r(4),g=r.n(p),w=r(18),h=r.n(w),O=r(208),v=r.n(O);const j=(e,t,r="...")=>v()(e,{suffix:r,limit:t}).html,_=(e,t,r)=>(t<=r?e.start=e.middle+1:e.end=e.middle-1,e),f=(e,t,r,o)=>{const c=((e,t,r)=>{let o={start:0,middle:0,end:e.length};for(;o.start<=o.end;)o.middle=Math.floor((o.start+o.end)/2),t.innerHTML=j(e,o.middle),o=_(o,t.clientHeight,r);return o.middle})(e,t,r);return j(e,c-o.length,o)},y={className:"read-more-content",ellipsis:"&hellip;",lessText:Object(c.__)("Read less","woocommerce"),maxLines:3,moreText:Object(c.__)("Read more","woocommerce")};class k extends o.Component{constructor(e){super(e),h()(this,"reviewSummary",void 0),h()(this,"reviewContent",void 0),this.state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},this.reviewContent=Object(o.createRef)(),this.reviewSummary=Object(o.createRef)(),this.getButton=this.getButton.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){this.setSummary()}componentDidUpdate(e){e.maxLines===this.props.maxLines&&e.children===this.props.children||this.setState({clampEnabled:null,summary:"."},this.setSummary)}setSummary(){if(this.props.children){const{maxLines:e,ellipsis:t}=this.props;if(!this.reviewSummary.current||!this.reviewContent.current)return;const r=(this.reviewSummary.current.clientHeight+1)*e+1,o=this.reviewContent.current.clientHeight+1>r;this.setState({clampEnabled:o}),o&&this.setState({summary:f(this.reviewContent.current.innerHTML,this.reviewSummary.current,r,t)})}}getButton(){const{isExpanded:e}=this.state,{className:t,lessText:r,moreText:c}=this.props,n=e?r:c;if(n)return Object(o.createElement)("a",{href:"#more",className:t+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},n)}onClick(e){e.preventDefault();const{isExpanded:t}=this.state;this.setState({isExpanded:!t})}render(){const{className:e}=this.props,{content:t,summary:r,clampEnabled:c,isExpanded:n}=this.state;return t?!1===c?Object(o.createElement)("div",{className:e},Object(o.createElement)("div",{ref:this.reviewContent},t)):Object(o.createElement)("div",{className:e},(!n||null===c)&&Object(o.createElement)("div",{ref:this.reviewSummary,"aria-hidden":n,dangerouslySetInnerHTML:{__html:r}}),(n||null===c)&&Object(o.createElement)("div",{ref:this.reviewContent,"aria-hidden":!n},t),this.getButton()):null}}h()(k,"defaultProps",y);var E=k;r(222);var R=({attributes:e,review:t={}})=>{const{imageType:r,showReviewDate:n,showReviewerName:a,showReviewImage:s,showReviewRating:i,showReviewContent:l,showProductName:d}=e,{rating:u}=t,b=!(Object.keys(t).length>0),m=Number.isFinite(u)&&i;return Object(o.createElement)("li",{className:g()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":b,"wc-block-components-review-list-item__item--has-image":s}),"aria-hidden":b},(d||n||a||s||m)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},s&&function(e,t,r){var n,a;return r||!e?Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(o.createElement)("img",{"aria-hidden":"true",alt:(null===(n=e.product_image)||void 0===n?void 0:n.alt)||"",src:(null===(a=e.product_image)||void 0===a?void 0:a.thumbnail)||""}):Object(o.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(o.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(c.__)("Verified buyer","woocommerce")},Object(c.__)("Verified buyer","woocommerce")))}(t,r,b),(d||a||m||n)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},m&&function(e){const{rating:t}=e,r={width:t/5*100+"%"},n=Object(c.sprintf)(/* translators: %f is referring to the average rating value */
Object(c.__)("Rated %f out of 5","woocommerce"),t),a={__html:Object(c.sprintf)(/* translators: %s is referring to the average rating value */
Object(c.__)("Rated %s out of 5","woocommerce"),Object(c.sprintf)('<strong class="rating">%f</strong>',t))};return Object(o.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(o.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":n},Object(o.createElement)("span",{style:r,dangerouslySetInnerHTML:a})))}(t),d&&function(e){return Object(o.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(o.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(t),a&&function(e){const{reviewer:t=""}=e;return Object(o.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},t)}(t),n&&function(e){const{date_created:t,formatted_date_created:r}=e;return Object(o.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(t))),l&&function(e){return Object(o.createElement)(E,{maxLines:10,moreText:Object(c.__)("Read full review","woocommerce"),lessText:Object(c.__)("Hide full review","woocommerce"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(o.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(t))};r(221);var C=({attributes:e,reviews:t})=>{const r=Object(i.getSetting)("showAvatars",!0),c=Object(i.getSetting)("reviewRatingsEnabled",!0),n=(r||"product"===e.imageType)&&e.showReviewImage,a=c&&e.showReviewRating,s={...e,showReviewImage:n,showReviewRating:a};return Object(o.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===t.length?Object(o.createElement)(R,{attributes:s}):t.map(((e,t)=>Object(o.createElement)(R,{key:e.id||t,attributes:s,review:e}))))},S=r(25),N=r.n(S),P=r(67),x=r(28);class I extends o.Component{render(){const{attributes:e,error:t,isLoading:r,noReviewsPlaceholder:n,reviews:s,totalReviews:d}=this.props;if(t)return Object(o.createElement)(l.a,{className:"wc-block-featured-product-error",error:t,isLoading:r});if(0===s.length&&!r)return Object(o.createElement)(n,{attributes:e});const b=Object(i.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(a.Disabled,null,e.showOrderby&&b&&Object(o.createElement)(m,{readOnly:!0,value:e.orderby,onChange:()=>null}),Object(o.createElement)(C,{attributes:e,reviews:s}),e.showLoadMore&&d>s.length&&Object(o.createElement)(u,{screenReaderLabel:Object(c.__)("Load more reviews","woocommerce")}))}}var T=(e=>{class t extends o.Component{constructor(...e){super(...e),h()(this,"isPreview",!!this.props.attributes.previewReviews),h()(this,"delayedAppendReviews",this.props.delayFunction(this.appendReviews)),h()(this,"isMounted",!1),h()(this,"state",{error:null,loading:!0,reviews:this.isPreview?this.props.attributes.previewReviews:[],totalReviews:this.isPreview?this.props.attributes.previewReviews.length:0}),h()(this,"setError",(async e=>{if(!this.isMounted)return;const{onReviewsLoadError:t}=this.props,r=await Object(x.a)(e);this.setState({reviews:[],loading:!1,error:r}),t(r)}))}componentDidMount(){this.isMounted=!0,this.replaceReviews()}componentDidUpdate(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}shouldReplaceReviews(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!N()(e.categoryIds,t.categoryIds)}componentWillUnmount(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}getArgs(e){const{categoryIds:t,order:r,orderby:o,productId:c,reviewsToDisplay:n}=this.props,a={order:r,orderby:o,per_page:n-e,offset:e};if(t){const e=Array.isArray(t)?t:JSON.parse(t);a.category_id=Array.isArray(e)?e.join(","):e}return c&&(a.product_id=c),a}replaceReviews(){if(this.isPreview)return;const{onReviewsReplaced:e}=this.props;this.updateListOfReviews().then(e)}appendReviews(){if(this.isPreview)return;const{onReviewsAppended:e,reviewsToDisplay:t}=this.props,{reviews:r}=this.state;t<=r.length||this.updateListOfReviews(r).then(e)}updateListOfReviews(e=[]){const{reviewsToDisplay:t}=this.props,{totalReviews:r}=this.state,o=Math.min(r,t)-e.length;return this.setState({loading:!0,reviews:e.concat(Array(o).fill({}))}),Object(P.c)(this.getArgs(e.length)).then((({reviews:t,totalReviews:r})=>(this.isMounted&&this.setState({reviews:e.filter((e=>Object.keys(e).length)).concat(t),totalReviews:r,loading:!1,error:null}),{newReviews:t}))).catch(this.setError)}render(){const{reviewsToDisplay:t}=this.props,{error:r,loading:c,reviews:n,totalReviews:a}=this.state;return Object(o.createElement)(e,{...this.props,error:r,isLoading:c,reviews:n.slice(0,t),totalReviews:a})}}h()(t,"defaultProps",{delayFunction:e=>e,onReviewsAppended:()=>{},onReviewsLoadError:()=>{},onReviewsReplaced:()=>{}});const{displayName:r=e.name||"Component"}=e;return t.displayName=`WithReviews( ${r} )`,t})(I);t.a=({attributes:e,icon:t,name:r,noReviewsPlaceholder:i})=>{const{categoryIds:l,productId:d,reviewsOnPageLoad:u,showProductName:b,showReviewDate:m,showReviewerName:p,showReviewContent:g,showReviewImage:w,showReviewRating:h}=e,{order:O,orderby:v}=Object(P.d)(e.orderby),j=!(g||h||m||p||w||b),_=Object(s.useBlockProps)({className:Object(P.a)(e)});return j?Object(o.createElement)(a.Placeholder,{icon:t,label:r},Object(c.__)("The content for this block is hidden due to block settings.","woocommerce")):Object(o.createElement)("div",{..._},Object(o.createElement)(T,{attributes:e,categoryIds:l,delayFunction:e=>Object(n.a)(e,400),noReviewsPlaceholder:i,orderby:v,order:O,productId:d,reviewsToDisplay:u}))}},188:function(e,t){},189:function(e,t){},2:function(e,t){e.exports=window.wp.components},220:function(e,t){},221:function(e,t){},222:function(e,t){},223:function(e,t){},23:function(e,t,r){"use strict";r.d(t,"h",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"b",(function(){return u})),r.d(t,"i",(function(){return b})),r.d(t,"f",(function(){return m})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return g})),r.d(t,"g",(function(){return w})),r.d(t,"a",(function(){return h}));var o=r(15),c=r(14),n=r.n(c),a=r(3),s=r(17);const i=(e,t)=>{const r=new Map;return e.filter((e=>{const o=t(e);return!r.has(o)&&(r.set(o,e),!0)}))},l=({selected:e=[],search:t="",queryArgs:r={}})=>{const c=(({selected:e=[],search:t="",queryArgs:r={}})=>{const c=s.p.productCount>100,n={per_page:c?100:0,catalog_visibility:"any",search:t,orderby:"title",order:"asc"},a=[Object(o.addQueryArgs)("/wc/store/v1/products",{...n,...r})];return c&&e.length&&a.push(Object(o.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:e,per_page:0})),a})({selected:e,search:t,queryArgs:r});return Promise.all(c.map((e=>n()({path:e})))).then((e=>{const t=e.flat();return i(t,(e=>e.id)).map((e=>({...e,parent:0})))})).catch((e=>{throw e}))},d=e=>n()({path:`/wc/store/v1/products/${e}`}),u=()=>n()({path:"wc/store/v1/products/attributes"}),b=e=>n()({path:`wc/store/v1/products/attributes/${e}/terms`}),m=({selected:e=[],search:t})=>{const r=(({selected:e=[],search:t})=>{const r=Object(a.getSetting)("limitTags",!1),c=[Object(o.addQueryArgs)("wc/store/v1/products/tags",{per_page:r?100:0,orderby:r?"count":"name",order:r?"desc":"asc",search:t})];return r&&e.length&&c.push(Object(o.addQueryArgs)("wc/store/v1/products/tags",{include:e})),c})({selected:e,search:t});return Promise.all(r.map((e=>n()({path:e})))).then((e=>{const t=e.flat();return i(t,(e=>e.id))}))},p=e=>n()({path:Object(o.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),g=e=>n()({path:`wc/store/v1/products/categories/${e}`}),w=e=>n()({path:Object(o.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),h=(e,t)=>{if(!e.title.raw)return e.slug;const r=1===t.filter((t=>t.title.raw===e.title.raw)).length;return e.title.raw+(r?"":` - ${e.slug}`)}},25:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));const o=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}}},289:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));const o=(e,t,r)=>{let o,c=null;const n=(...n)=>{c=n,o&&clearTimeout(o),o=setTimeout((()=>{o=null,!r&&c&&e(...c)}),t),r&&!o&&e(...n)};return n.flush=()=>{o&&c&&(e(...c),clearTimeout(o),o=null)},n}},29:function(e,t,r){"use strict";var o=r(0),c=r(4),n=r.n(c);t.a=({label:e,screenReaderLabel:t,wrapperElement:r,wrapperProps:c={}})=>{let a;const s=null!=e,i=null!=t;return!s&&i?(a=r||"span",c={...c,className:n()(c.className,"screen-reader-text")},Object(o.createElement)(a,{...c},t)):(a=r||o.Fragment,s&&i&&e!==t?Object(o.createElement)(a,{...c},Object(o.createElement)("span",{"aria-hidden":"true"},e),Object(o.createElement)("span",{className:"screen-reader-text"},t)):Object(o.createElement)(a,{...c},e))}},3:function(e,t){e.exports=window.wc.wcSettings},31:function(e,t){e.exports=window.wp.escapeHtml},34:function(e,t,r){"use strict";var o=r(0),c=r(1),n=r(31);t.a=({error:e})=>Object(o.createElement)("div",{className:"wc-block-error-message"},(({message:e,type:t})=>e?"general"===t?Object(o.createElement)("span",null,Object(c.__)("The following error was returned","woocommerce"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(n.escapeHTML)(e))):"api"===t?Object(o.createElement)("span",null,Object(c.__)("The following error was returned from the API","woocommerce"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(n.escapeHTML)(e))):e:Object(c.__)("An error has prevented the block from being updated.","woocommerce"))(e))},35:function(e,t,r){"use strict";r.d(t,"a",(function(){return b}));var o=r(0),c=r(4),n=r.n(c),a=r(2);function s(e,t,r){const o=new Set(t.map((e=>e[r])));return e.filter((e=>!o.has(e[r])))}var i=r(10),l=r(16);const d=({label:e})=>Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},e),u=e=>{const{item:t,search:r}=e,c=t.breadcrumbs&&t.breadcrumbs.length;return Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},c?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(t.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(Object(i.decodeEntities)(t.name),r)))},b=({countLabel:e,className:t,depth:r=0,controlId:c="",item:b,isSelected:m,isSingle:p,onSelect:g,search:w="",selected:h,useExpandedPanelId:O,...v})=>{var j,_;const[f,y]=O,k=null!=e&&void 0!==b.count&&null!==b.count,E=!(null===(j=b.breadcrumbs)||void 0===j||!j.length),R=!(null===(_=b.children)||void 0===_||!_.length),C=f===b.id,S=n()(["woocommerce-search-list__item",`depth-${r}`,t],{"has-breadcrumbs":E,"has-children":R,"has-count":k,"is-expanded":C,"is-radio-button":p}),N=v.name||`search-list-item-${c}`,P=`${N}-${b.id}`,x=Object(o.useCallback)((()=>{y(C?-1:Number(b.id))}),[C,b.id,y]);return R?Object(o.createElement)("div",{className:S,onClick:x,onKeyDown:e=>"Enter"===e.key||" "===e.key?x():null,role:"treeitem",tabIndex:0},p?Object(o.createElement)(o.Fragment,null,Object(o.createElement)("input",{type:"radio",id:P,name:N,value:b.value,onChange:g(b),onClick:e=>e.stopPropagation(),checked:m,className:"woocommerce-search-list__item-input",...v}),Object(o.createElement)(u,{item:b,search:w}),k?Object(o.createElement)(d,{label:e||b.count}):null):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.CheckboxControl,{className:"woocommerce-search-list__item-input",checked:m,...!m&&b.children.some((e=>h.find((t=>t.id===e.id))))?{indeterminate:!0}:{},label:Object(l.d)(Object(i.decodeEntities)(b.name),w),onChange:()=>{m?g(s(h,b.children,"id"))():g(function(e,t,r){const o=s(t,e,"id");return[...e,...o]}(h,b.children))()},onClick:e=>e.stopPropagation()}),k?Object(o.createElement)(d,{label:e||b.count}):null)):Object(o.createElement)("label",{htmlFor:P,className:S},p?Object(o.createElement)(o.Fragment,null,Object(o.createElement)("input",{type:"radio",id:P,name:N,value:b.value,onChange:g(b),checked:m,className:"woocommerce-search-list__item-input",...v}),Object(o.createElement)(u,{item:b,search:w})):Object(o.createElement)(a.CheckboxControl,{id:P,name:N,className:"woocommerce-search-list__item-input",value:Object(i.decodeEntities)(b.value),label:Object(l.d)(Object(i.decodeEntities)(b.name),w),onChange:g(b),checked:m,...v}),k?Object(o.createElement)(d,{label:e||b.count}):null)};t.b=b},5:function(e,t){e.exports=window.wp.blockEditor},54:function(e,t){},545:function(e,t,r){e.exports=r(584)},55:function(e,t){},57:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));const o=(e,t)=>e.reduce(((e,r)=>(e[String(t?r[t]:r)]=r,e)),{})},584:function(e,t,r){"use strict";r.r(t);var o=r(0),c=r(1),n=r(7),a=r(70),s=r(275),i=r(5),l=r(2),d=r(65),u=r(175),b=()=>Object(o.createElement)(l.Placeholder,{className:"wc-block-reviews-by-category",icon:Object(o.createElement)(a.a,{icon:s.a,className:"block-editor-block-icon"}),label:Object(c.__)("Reviews by Category","woocommerce")},Object(c.__)("This block lists reviews for products from selected categories. The selected categories do not have any reviews yet, but they will show up here when they do.","woocommerce")),m=r(124),p=Object(l.withSpokenMessages)((({attributes:e,debouncedSpeak:t,setAttributes:r})=>{const{editMode:n,categoryIds:p}=e;if(!p||n)return Object(o.createElement)(l.Placeholder,{icon:Object(o.createElement)(a.a,{icon:s.a,className:"block-editor-block-icon"}),label:Object(c.__)("Reviews by Category","woocommerce"),className:"wc-block-reviews-by-category"},Object(c.__)("Show product reviews from specific categories.","woocommerce"),Object(o.createElement)("div",{className:"wc-block-reviews__selection"},Object(o.createElement)(d.a,{selected:e.categoryIds,onChange:(e=[])=>{const t=e.map((({id:e})=>e));r({categoryIds:t})},showReviewCount:!0}),Object(o.createElement)(l.Button,{isPrimary:!0,onClick:()=>{r({editMode:!1}),t(Object(c.__)("Now displaying a preview of the reviews for the products in the selected categories.","woocommerce"))}},Object(c.__)("Done","woocommerce"))));const g=Object(c.__)("Edit selected categories","woocommerce");return Object(o.createElement)(o.Fragment,null,Object(m.a)(n,r,g),Object(o.createElement)(i.InspectorControls,{key:"inspector"},Object(o.createElement)(l.PanelBody,{title:Object(c.__)("Category","woocommerce"),initialOpen:!1},Object(o.createElement)(d.a,{selected:e.categoryIds,onChange:(e=[])=>{const t=e.map((({id:e})=>e));r({categoryIds:t})},isCompact:!0,showReviewCount:!0})),Object(o.createElement)(l.PanelBody,{title:Object(c.__)("Content","woocommerce")},Object(o.createElement)(l.ToggleControl,{label:Object(c.__)("Product name","woocommerce"),checked:e.showProductName,onChange:()=>r({showProductName:!e.showProductName})}),Object(m.b)(e,r)),Object(o.createElement)(l.PanelBody,{title:Object(c.__)("List Settings","woocommerce")},Object(m.c)(e,r))),Object(o.createElement)(u.a,{attributes:e,icon:Object(o.createElement)(a.a,{icon:s.a,className:"block-editor-block-icon"}),name:Object(c.__)("Reviews by Category","woocommerce"),noReviewsPlaceholder:b}))})),g=r(168),w=r(169),h=r(143);Object(n.registerBlockType)("woocommerce/reviews-by-category",{apiVersion:2,title:Object(c.__)("Reviews by Category","woocommerce"),icon:{src:Object(o.createElement)(a.a,{icon:s.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(c.__)("WooCommerce","woocommerce")],description:Object(c.__)("Show product reviews from specific categories.","woocommerce"),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:{...h.a,attributes:{...h.a.attributes,categoryIds:[1],showProductName:!0}},attributes:{...g.a,categoryIds:{type:"array",default:[]},showProductName:{type:"boolean",default:!0}},edit:e=>{const t=Object(i.useBlockProps)();return Object(o.createElement)("div",{...t},Object(o.createElement)(p,{...e}))},save:w.a})},65:function(e,t,r){"use strict";var o=r(0),c=r(1),n=r(35),a=r(102),s=r(2),i=r(11),l=r(23),d=r(28);const u=Object(i.createHigherOrderComponent)((e=>class extends o.Component{constructor(){super(...arguments),this.state={error:null,loading:!1,categories:[]},this.loadCategories=this.loadCategories.bind(this)}componentDidMount(){this.loadCategories()}loadCategories(){this.setState({loading:!0}),Object(l.c)().then((e=>{this.setState({categories:e,loading:!1,error:null})})).catch((async e=>{const t=await Object(d.a)(e);this.setState({categories:[],loading:!1,error:t})}))}render(){const{error:t,loading:r,categories:c}=this.state;return Object(o.createElement)(e,{...this.props,error:t,isLoading:r,categories:c})}}),"withCategories");var b=u,m=r(34),p=r(4),g=r.n(p);r(106);const w=({categories:e,error:t,isLoading:r,onChange:i,onOperatorChange:l,operator:d,selected:u,isCompact:b,isSingle:p,showReviewCount:w})=>{const h={clear:Object(c.__)("Clear all product categories","woocommerce"),list:Object(c.__)("Product Categories","woocommerce"),noItems:Object(c.__)("Your store doesn't have any product categories.","woocommerce"),search:Object(c.__)("Search for product categories","woocommerce"),selected:e=>Object(c.sprintf)(/* translators: %d is the count of selected categories. */
Object(c._n)("%d category selected","%d categories selected",e,"woocommerce"),e),updated:Object(c.__)("Category search results updated.","woocommerce")};return t?Object(o.createElement)(m.a,{error:t}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.a,{className:"woocommerce-product-categories",list:e,isLoading:r,selected:u.map((t=>e.find((e=>e.id===t)))).filter(Boolean),onChange:i,renderItem:e=>{const{item:t,search:r,depth:a=0}=e,s=t.breadcrumbs.length?`${t.breadcrumbs.join(", ")}, ${t.name}`:t.name,i=w?Object(c.sprintf)(/* translators: %1$s is the item name, %2$d is the count of reviews for the item. */
Object(c._n)("%1$s, has %2$d review","%1$s, has %2$d reviews",t.review_count,"woocommerce"),s,t.review_count):Object(c.sprintf)(/* translators: %1$s is the item name, %2$d is the count of products for the item. */
Object(c._n)("%1$s, has %2$d product","%1$s, has %2$d products",t.count,"woocommerce"),s,t.count),l=w?Object(c.sprintf)(/* translators: %d is the count of reviews. */
Object(c._n)("%d review","%d reviews",t.review_count,"woocommerce"),t.review_count):Object(c.sprintf)(/* translators: %d is the count of products. */
Object(c._n)("%d product","%d products",t.count,"woocommerce"),t.count);return Object(o.createElement)(n.a,{className:g()("woocommerce-product-categories__item","has-count",{"is-searching":r.length>0,"is-skip-level":0===a&&0!==t.parent}),...e,countLabel:l,"aria-label":i})},messages:h,isCompact:b,isHierarchical:!0,isSingle:p}),!!l&&Object(o.createElement)("div",{hidden:u.length<2},Object(o.createElement)(s.SelectControl,{className:"woocommerce-product-categories__operator",label:Object(c.__)("Display products matching","woocommerce"),help:Object(c.__)("Pick at least two categories to use this setting.","woocommerce"),value:d,onChange:l,options:[{label:Object(c.__)("Any selected categories","woocommerce"),value:"any"},{label:Object(c.__)("All selected categories","woocommerce"),value:"all"}]})))};w.defaultProps={operator:"any",isCompact:!1,isSingle:!1},t.a=b(w)},67:function(e,t,r){"use strict";r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return u}));var o=r(14),c=r.n(o),n=r(4),a=r.n(n),s=r(3);const i=e=>{if(Object(s.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=e=>c()({path:"/wc/store/v1/products/reviews?"+Object.entries(e).map((e=>e.join("="))).join("&"),parse:!1}).then((e=>e.json().then((t=>({reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}))))),d=e=>{const{className:t,categoryIds:r,productId:o,showReviewDate:c,showReviewerName:n,showReviewContent:s,showProductName:i,showReviewImage:l,showReviewRating:d}=e;let u="wc-block-all-reviews";return o&&(u="wc-block-reviews-by-product"),Array.isArray(r)&&(u="wc-block-reviews-by-category"),a()(u,t,{"has-image":l,"has-name":n,"has-date":c,"has-rating":d,"has-content":s,"has-product-name":i})},u=e=>{const{categoryIds:t,imageType:r,orderby:o,productId:c,reviewsOnPageLoad:n,reviewsOnLoadMore:a,showLoadMore:s,showOrderby:i}=e,l={"data-image-type":r,"data-orderby":o,"data-reviews-on-page-load":n,"data-reviews-on-load-more":a,"data-show-load-more":s,"data-show-orderby":i};return c&&(l["data-product-id"]=c),Array.isArray(t)&&(l["data-category-ids"]=t.join(",")),l}},7:function(e,t){e.exports=window.wp.blocks},88:function(e,t,r){"use strict";var o=r(0),c=r(1),n=r(70),a=r(212),s=r(4),i=r.n(s),l=r(2),d=r(34);r(131),t.a=({className:e,error:t,isLoading:r=!1,onRetry:s})=>Object(o.createElement)(l.Placeholder,{icon:Object(o.createElement)(n.a,{icon:a.a}),label:Object(c.__)("Sorry, an error occurred","woocommerce"),className:i()("wc-block-api-error",e)},Object(o.createElement)(d.a,{error:t}),s&&Object(o.createElement)(o.Fragment,null,r?Object(o.createElement)(l.Spinner,null):Object(o.createElement)(l.Button,{isSecondary:!0,onClick:s},Object(c.__)("Retry","woocommerce"))))},9:function(e,t){e.exports=window.wp.primitives}});